package ortustve;


import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.List;
import java.util.concurrent.TimeUnit;

import sagex.UIContext;
import sagex.api.MediaFileAPI;

import ortustve.ui.menu.usermenu;
import ortustve.media.metadata.MetadataFactory;

/**
 *
 * @author TeamORTUS
 */
public class api extends ortusvars {

	public static String GetVersion() {
		return "0.5.08.367";
	}

	public static String GetVersionFull() {
		return "0.5.08.367;5/15/2011 17:30";
	}

	public static Object SageCall(SageMediaObject o, String sagemethod) {
		return o.SageCall(sagemethod);
	}

	/**
	 *
	 * @param context
	 */
	public static void Setup(String context) {
		Setup(context, "");
	}

	/**
	 *
	 * @return
	 */
	public static boolean IsOrtusInitialized() {
		return Ortus.getInstance().IsOrtusInitialized();
	}
/**
 * Setup Ortus Environment
 * @param context Context from the STV
 * @param activatemodules Modules to activate.  Currently:
 *	DB - H2 Database Engine
 *	Theme - Ortus Theme Engine
 *	Menu - Ortus Menu Engine
 *	FavoriteExcluder - Favorite Excluder Engine
 */
	public static void Setup(String context, String activatemodules){
		Ortus.getInstance().Configure(context, activatemodules);
	}

	/**
	 *
	 */
	public static void Shutdown() {
		Ortus.getInstance().Shutdown();
	}

		/**
	 *
	 * @return
	 */
	public static String GetUIContextName() {
		return ortustve.util.UIC.GetUIContextName();
	}

	/**
	 *
	 * @return
	 */
	public static UIContext GetUIContext() {
		return ortustve.util.UIC.GetUIContext();
	}

	/**
	 *
	 * @param UIC_Str
	 */
	public static void StoreUIContextName(String UIC_Str) {
		ortustve.util.UIC.StoreUIContextName(UIC_Str);
		return;
	}

	public static Object GetMediaObject(Object o1, Object o2) {
		return ortustve.util.ui.GetMediaObject(o1, o2);
	}

	/**
	 *
	 * @return
	 */
	public static String GetMACAddress() {
		return Ortus.getInstance().GetMACAddress();
	}

// Debug Logging
	/*
	 * ortus api DebugLog.  Prints message to the sage debug log.
	 * debug_logging=TRUE
	 * configure with .properties item ortus/debug_log_level
	 * All messages with a MsgLevel less then or equal to debug_log_level are output
	 *
	 * ALL = 7
	 * TRACE = 6
	 * DEBUG = 5
	 * INFO = 4
	 * WARNING = 3
	 * ERROR = 2
	 * FATAL = 1
	 * OFF = 0
	 *
	 * @param MsgLevel Message Level String
	 * @param MsgString Message String
	 *
	 */
	public static void SetLoggerSageAll() {
		Ortus.getInstance().getLogger().SetSageAll();
	}
	public static void SetLoggerSageTrace() {
		Ortus.getInstance().getLogger().SetSageTrace();
	}
	public static void SetLoggerSageDebug() {
		Ortus.getInstance().getLogger().SetSageDebug();
	}
	public static void SetLoggerSageInfo() {
		Ortus.getInstance().getLogger().SetSageInfo();
	}
	public static void SetLoggerSageWarn() {
		Ortus.getInstance().getLogger().SetSageWarn();
	}
	public static void SetLoggerSageError() {
		Ortus.getInstance().getLogger().SetSageError();
	}
	public static void SetLoggerSageFatal() {
		Ortus.getInstance().getLogger().SetSageFatal();
	}
	public static void SetLoggerSageOff() {
		Ortus.getInstance().getLogger().SetSageOff();
	}
	public static void SetLoggerLog4jAll() {
		Ortus.getInstance().getLogger().SetLog4jAll();
	}
	public static void SetLoggerLog4jTrace() {
		Ortus.getInstance().getLogger().SetLog4jTrace();
	}
	public static void SetLoggerLog4jDebug() {
		Ortus.getInstance().getLogger().SetLog4jDebug();
	}
	public static void SetLoggerLog4jInfo() {
		Ortus.getInstance().getLogger().SetLog4jInfo();
	}
	public static void SetLoggerLog4jWarn() {
		Ortus.getInstance().getLogger().SetLog4jWarn();
	}
	public static void SetLoggerLog4jError() {
		Ortus.getInstance().getLogger().SetLog4jError();
	}
	public static void SetLoggerLog4jFatal() {
		Ortus.getInstance().getLogger().SetLog4jFatal();
	}
	public static void SetLoggerLog4jOff() {
		Ortus.getInstance().getLogger().SetLog4jOff();
	}
	/**
	 *
	 * @param MsgLevel
	 * @param MsgString
	 */
	public static void DebugLog(Object MsgLevel, String MsgString) {
		Ortus.getInstance().getLogger().DebugLog(MsgLevel, MsgString);
	}
	/**
	 *
	 * @param MsgLevel
	 * @param MsgString
	 */
	@SuppressWarnings("static-access")
	public static void DebugLogDB(Object MsgLevel, String MsgString) {
		Ortus.getInstance().getLogger().DebugLogDB(MsgLevel, MsgString);
	}
	/**
	 *
	 * @param MsgLevel
	 * @return
	 */
	@SuppressWarnings("static-access")
	public static List<Object> GetDebugLogDB(int MsgLevel) {
		return Ortus.getInstance().getLogger().GetDebugLogDB(MsgLevel);
	}
	
	public static void ReLoadCache() {
		ortustve.cache.cacheEngine.getInstance().ReLoadCache();
	}
// Custom Filters
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static boolean IsGeneralTV(Object MediaObject) {
            return ortustve.media.CustomFilters.IsGeneralTV(MediaObject);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetGenre(Object MediaObject) {
            return ortustve.media.CustomFilters.GetGenre(MediaObject);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetActor(Object MediaObject) {
            return ortustve.media.CustomFilters.GetActor(MediaObject);
        }
//        public static String GetDescription(Object MediaObject) {
//            return CustomFilters.GetDescription(MediaObject);
//        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetWriter(Object MediaObject) {
            return ortustve.media.CustomFilters.GetWriter(MediaObject);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetDirector(Object MediaObject) {
            return ortustve.media.CustomFilters.GetDirector(MediaObject);
        }

//	Ortus Favorite Excluder interface
	/**
	 * Verify a valid Favorite Excluder File
	 *
	 * @return
	 */
	public static boolean ValidExcludeFile() {
		return Ortus.getInstance().getFavoriteExcluder().ValidExcluderFile();
	}
	/**
	 * Run Favorite Excluder Scan
	 */
	public static void RunExcluder() {
		Ortus.getInstance().getFavoriteExcluder().RunExcluder();
		return;
	}
	
	/**
	 *
	 * @return
	 */
	public static String GetClientName() {
            return Ortus.getInstance().getIdentity().GetClientName();
        }

	/**
	 *
	 * @param clientname
	 */
	public static void SetClientName(String clientname) {
            Ortus.getInstance().getIdentity().SetClientName(clientname);
            return;
        }

	/**
	 *
	 * @param PropName
	 * @return
	 */
	public static String GetProperty(String PropName) {
		return Ortus.getInstance().getProperty().GetProperty(PropName, null);
	}
//	Ortus Property interface
	/**
	 * Get a property value
	 * @param PropName Property Name
	 * @param defaultvalue
	 * @return Property Value
	 */
	public static String GetProperty(String PropName, String defaultvalue) {
		return Ortus.getInstance().getProperty().GetProperty(PropName, defaultvalue);
	}

	/**
	 * Set a property value
	 * @param PropName Property Name
	 * @param PropValue Property Value
	 */
	public static void SetProperty(String PropName, Object PropValue) {
		api.DebugLog(api.TRACE, "SetProperty: propname: " + PropName + " value: " + PropValue);
		Ortus.getInstance().getProperty().SetProperty(PropName, PropValue.toString());
		return;
	}

	/**
	 * Delete a property
	 * @param PropName Property Name
	 */
	public static void RemoveProperty(String PropName) {
		Ortus.getInstance().getProperty().RemoveProperty(PropName);
		return;
	}

//SageProperty.java
	/**
	 *
	 * @param PropName
	 * @param DefValue
	 * @return
	 */
	public static String GetSageProperty(String PropName, String DefValue) {
		return ortustve.property.SageProperty.GetSageProperty(PropName, DefValue);
	}

	/**
	 *
	 * @param PropName
	 * @param Value
	 */
	public static void SetSageProperty(String PropName, String Value) {
		ortustve.property.SageProperty.SetSageProperty(PropName, Value);
		return;
	}

	/**
	 *
	 * @param PropName
	 */
	public static void RemoveSageProperty(String PropName) {
		ortustve.property.SageProperty.RemoveSageProperty(PropName);
		return;
	}

	/**
	 *
	 * @param PropertyName
	 * @param DefaultValue
	 * @param Element
	 * @return
	 */
	public static String SetSagePropertyElement(String PropertyName, String DefaultValue, String Element) {
		return ortustve.property.SageProperty.SetSagePropertyElement(PropertyName, DefaultValue, Element);
	}

	public static String SetSagePropertyElement(String PropertyName, String Element) {
		return ortustve.property.SageProperty.SetSagePropertyElement(PropertyName, "", Element);
	}

	/**
	 *
	 * @param PropertyName
	 * @param DefaultValue
	 * @param Element
	 * @return
	 */
	public static String RemoveSagePropertyElement(String PropertyName, String DefaultValue, String Element) {
		return ortustve.property.SageProperty.RemoveSagePropertyElement(PropertyName, DefaultValue, Element);
	}
	
	public static String RemoveSagePropertyElement(String PropertyName, String Element) {
		return ortustve.property.SageProperty.RemoveSagePropertyElement(PropertyName, "", Element);
	}

	public static boolean HasSagePropertyElement(String PropertyName, String DefaultValue, String Element) {
		return ortustve.property.SageProperty.HasSagePropertyElement(PropertyName, DefaultValue, Element);
	}
	public static boolean HasSagePropertyElement(String PropertyName, String Element) {
		return ortustve.property.SageProperty.HasSagePropertyElement(PropertyName, "", Element);
	}

	/**
	 *
	 * @param PropertyName
	 * @param DefaultValue
	 * @return
	 */
	public static String[] GetSagePropertyArray(String PropertyName, String DefaultValue) {
		return ortustve.property.SageProperty.GetSagePropertyArray(PropertyName, DefaultValue);
	}

	/**
	 *
	 * @param filename
	 */
	public static void LoadSagePropertyFile(String filename){
		ortustve.property.SageProperty.LoadSagePropertyFile(filename);
		return;
	}

	/**
	 *
	 * @param property
	 * @return
	 */
	public static String[] GetSageSubpropertiesThatAreBranches(String property){
		return ortustve.property.SageProperty.GetSageSubpropertiesThatAreBranches(property);
	}

	/**
	 *
	 * @param property
	 * @return
	 */
	public static String[] GetSageSubpropertiesThatAreLeaves(String property){
		return ortustve.property.SageProperty.GetSageSubpropertiesThatAreLeaves(property);
	}

	/**
	 *
	 * @param parentprop
	 * @return
	 */
	public static ArrayList GetSagePropertyAndChildren(String parentprop){
		return ortustve.property.SageProperty.GetGetPropertyAndChildren(parentprop);
	}

	/**
	 *
	 * @param filename
	 * @param parentprop
	 * @param DoNotSaveProps
	 * @return
	 */
	public static boolean SaveSagePropertyFile(String filename, String parentprop, String DoNotSaveProps){
		return ortustve.property.SageProperty.SaveSagePropertyFile(filename, parentprop, DoNotSaveProps);
	}

	/**
	 *
	 * @param filename
	 * @param parentprop
	 * @return
	 */
	public static boolean SaveSagePropertyFile(String filename, String parentprop){
		return ortustve.property.SageProperty.SaveSagePropertyFile(filename, parentprop, "");
	}

// SageServerProperty.java
		/**
	 *
	 * @param PropertyName
	 * @param DefaultValue
	 * @param Element
	 * @return
	 */
	public static String SetSageServerPropertyElement(String PropertyName, String DefaultValue, String Element) {
		return ortustve.property.SageServerProperty.SetSageServerPropertyElement(PropertyName, DefaultValue, Element);
	}

	public static String SetSageServerPropertyElement(String PropertyName, String Element) {
		return ortustve.property.SageServerProperty.SetSageServerPropertyElement(PropertyName, "", Element);
	}

	/**
	 *
	 * @param PropertyName
	 * @param DefaultValue
	 * @param Element
	 * @return
	 */
	public static String RemoveSageServerPropertyElement(String PropertyName, String DefaultValue, String Element) {
		return ortustve.property.SageServerProperty.RemoveSageServerPropertyElement(PropertyName, DefaultValue, Element);
	}

	public static String RemoveSageServerPropertyElement(String PropertyName, String Element) {
		return ortustve.property.SageServerProperty.RemoveSageServerPropertyElement(PropertyName, "", Element);
	}

	public static boolean HasSageServerPropertyElement(String PropertyName, String DefaultValue, String Element) {
		return ortustve.property.SageServerProperty.HasSageServerPropertyElement(PropertyName, DefaultValue, Element);
	}
	public static boolean HasSageServerPropertyElement(String PropertyName, String Element) {
		return ortustve.property.SageServerProperty.HasSageServerPropertyElement(PropertyName, "", Element);
	}
 
//Below is all calls related to Tag.java
	
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String[] GetMediaTags(Object MediaObject)
	{return ortustve.media.Tag.GetMediaTags(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @param Tag
	 * @return
	 */
	public static boolean HasMediaTag(Object MediaObject,String Tag)
	{return ortustve.media.Tag.HasMediaTag(MediaObject, Tag);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static boolean HasMediaTags(Object MediaObject)
	{return ortustve.media.Tag.HasMediaTags(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @param Tag
	 * @return
	 */
	public static String RemoveMediaTag(Object MediaObject,String Tag)
	{return ortustve.media.Tag.RemoveMediaTag(MediaObject, Tag);}
	
	/**
	 *
	 * @param MediaObject
	 * @param Tag
	 * @return
	 */
	public static String  SetMediaTag(Object MediaObject,String Tag)
	{return ortustve.media.Tag.SetMediaTag(MediaObject, Tag);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ClearMediaTags(Object MediaObject)
	{return ortustve.media.Tag.ClearMediaTags(MediaObject);}
	
	
//below is all calls related to scrubString

	
	/**
	 *
	 * @param s1
	 * @return
	 */
	public static String ScrubStringTitle(String s1)
	{return ortustve.util.scrubString.StringTitle(s1);}

	/**
	 *
	 * @param s1
	 * @return
	 */
	public static String ExtremeScrubStringTitle(String s1)
	{return ortustve.util.scrubString.ExtremeStringTitle(s1);}
		
//	public static String ScrubGetAiringTitle(Object MediaObject)
//	{return scrubString.GetAiringTitle(MediaObject);}
	
//	public static String ScrubGetMediaTitle(Object MediaObject)
//	{return scrubString.GetMediaTitle(MediaObject);}
//
//	public static String ScrubGetShowTitle(Object MediaObject)
//	{return scrubString.GetShowTitle(MediaObject);}
//
//	public static String ScrubGetShowEpisode(Object MediaObject)
//	{return scrubString.GetShowEpisode(MediaObject);}
//
//	public static String ScrubGetAlbumArtist(Object MediaObject)
//	{return scrubString.GetAlbumArtist(MediaObject);}
//
//	public static String ScrubGetAlbumName(Object MediaObject)
//	{return scrubString.GetAlbumName(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ScrubGetShowCategory(Object MediaObject)
	{return ortustve.util.scrubString.GetShowCategory(MediaObject);}
		
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ScrubGetShowSubCategory(Object MediaObject)
	{return ortustve.util.scrubString.GetShowSubCategory(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ScrubGetShowCombCategories(Object MediaObject)
	{return ortustve.util.scrubString.GetShowCombCategories(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String[] GetShowCategories(Object MediaObject)
	{return ortustve.util.scrubString.GetShowCategories(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ScrubGetShowDescription(Object MediaObject)
	{return ortustve.util.scrubString.GetShowDescription(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ScrubGetShowTagLine(Object MediaObject)
	{return ortustve.util.scrubString.GetShowTagLine(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String[] ScrubGetPeopleInShowRoleActor(Object MediaObject)
	{return ortustve.util.scrubString.GetPeopleInShowRoleActor(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String[] ScrubGetPeopleInShowRoleDirector(Object MediaObject)
	{return ortustve.util.scrubString.GetPeopleInShowRoleDirector(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String[] ScrubGetPeopleInShowRoleWriter(Object MediaObject)
	{return ortustve.util.scrubString.GetPeopleInShowRoleWriter(MediaObject);}
	
	/**
	 *
	 * @param Actor
	 * @return
	 */
	public static String ScrubGetActorName(String Actor)
	{return ortustve.util.scrubString.GetActorName(Actor);}
	
	/**
	 *
	 * @param Actor
	 * @return
	 */
	public static String ScrubGetActorRole(String Actor)
	{return ortustve.util.scrubString.GetActorRole(Actor);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String ScrubGetUserRating(Object MediaObject)
	{return ortustve.util.scrubString.GetUserRating(MediaObject);}
	
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static int ScrubGetShowDuration(Object MediaObject)
	{return ortustve.util.scrubString.GetShowDuration(MediaObject);}
	
	
//Utility.java

	/**
	 *
	 * @param Array
	 * @return
	 */
	public static Object[] toArray(Object Array)	{
		return ortustve.util.array.toArray(Array);
	}

	/**
	 * 
	 * @param m
	 * @return
	 */
	public static List GetMapKeysAsList(Map m) {
		return ortustve.util.array.GetMapKeysAsList(m);
	}

	/**
	 *
	 * @param l
	 * @param element
	 * @param index
	 * @return
	 */
	public static List MoveElementToIndex(List l, Object element, int index){
		return ortustve.util.array.MoveElementToIndex(l, element, index);
	}

	/**
	 *
	 * @param MediaObjects
	 * @param i1
	 * @param i2
	 * @return
	 */
	public static Object[] AddArrayElements(Object MediaObjects, int i1, int i2)	{
		return ortustve.util.array.AddArrayElements(MediaObjects, i1, i2);
	}

	/**
	 *
	 * @param logfile
	 * @return
	 */
	public static List<String> DumpLogFile(String logfile)	{
		return ortustve.util.dump.DumpLogFile(logfile);
	}

	/**
	 *
	 * @param folder
	 * @return
	 */
	public static List GetFolderDetail(String folder)	{
		return ortustve.util.file.GetFolderDetail(folder);
	}

	/**
	 *
	 * @param Array
	 * @return
	 */
	public static List GetFoldersDetails(Object Array)	{
		return ortustve.util.file.GetFoldersDetails(Array);
	}

	/**
	 *
	 * @param A
	 * @param wrt0
	 * @return
	 */
	public static double GetVerticalPositionWithOverscan(double A, boolean wrt0) {
		 return ortustve.util.ui.GetVerticalPositionWithOverscan(A, wrt0);
	 }

	/**
	 *
	 * @param A
	 * @param wrt0
	 * @return
	 */
	public static double GetHorizontalPositionWithOverscan(double A, boolean wrt0) {
		 return ortustve.util.ui.GetHorizontalPositionWithOverscan(A, wrt0);
	 }

	 /**
	  *
	  * @param filepath
	  * @return
	  */
	 public static boolean IsFilePath(String filepath){
		 return ortustve.util.file.IsFilePath(filepath);
	 }

	 public static String GetFilePathForSegment(Object mf, int segment){
		 return ortustve.util.file.GetFilePathForSegment(mf, segment);
	 }
	 /**
	  *
	  * @param str
	  * @return
	  */
	 public static String MD5Sum(String str) {
		 return ortustve.util.math.MD5Sum(str);
	 }
	 /**
	  *
	  * @param timestamp
	  * @return
	  */
	 public static long GetEpochFromDate(String timestamp) {
		 return ortustve.util.date.GetEpochFromDate(timestamp);
	 }
//Search.java
	
	 /**
	  *
	  * @param SearchString
	  * @return
	  */
	 public static Object search(String SearchString){
		return ortustve.media.Search.search(MediaFileAPI.GetMediaFiles(), SearchString, "");
	}

	 /**
	  *
	  * @param Source
	  * @param SearchString
	  * @return
	  */
	 public static Object search(Object Source, String SearchString){
		return ortustve.media.Search.search(api.toArray(Source), SearchString, "");
	}

	/**
	 *
	 * @param SearchString
	 * @param SortMethod
	 * @return
	 */
	public static Object search(String SearchString, String SortMethod){
		return ortustve.media.Search.search(MediaFileAPI.GetMediaFiles(), SearchString, SortMethod);
	}

	/**
	 *
	 * @param Source
	 * @param SearchString
	 * @param SortMethod
	 * @return
	 */
	public static Object search(Object Source, String SearchString, String SortMethod){
		return ortustve.media.Search.search(api.toArray(Source), SearchString, SortMethod);
	}

	/**
	 *
	 * @param SearchString
	 * @param SortMethod
	 * @param GroupByMethod
	 * @return
	 */
	public static Map search(String SearchString, String SortMethod, String GroupByMethod){
		return ortustve.media.Search.search(MediaFileAPI.GetMediaFiles(), SearchString, SortMethod, GroupByMethod);
	}

	/**
	 *
	 * @param Source
	 * @param SearchString
	 * @param SortMethod
	 * @param GroupByMethod
	 * @return
	 */
	public static Map search(Object Source, String SearchString, String SortMethod, String GroupByMethod){
		return ortustve.media.Search.search(api.toArray(Source), SearchString, SortMethod, GroupByMethod);
	}
	
	

// database.java calls
	/**
	 *
	 * @param MediaFiles
	 * @param filepos
	 * @return
	 */
	public static HashMap<String,List<Object>>GroupByPath(List<Object> MediaFiles, String filepos) {
            return ortustve.util.file.GroupByPath(MediaFiles, filepos);
        }

	/**
	 *
	 * @param SearchString
	 * @param MediaType
	 * @param size
	 * @return
	 */
	public static Object[] GetLastMediaAdded(String SearchString,String MediaType,int size){
            return ortustve.media.util.GetLastMediaAdded(SearchString, MediaType, size);
        }

	/**
	 *
	 * @param SearchString
	 * @param MediaType
	 * @return
	 */
	public static Object[] GetLastMediaAdded(String SearchString,String MediaType){
            return ortustve.media.util.GetLastMediaAdded(SearchString, MediaType, 10);
        }

// fanart.java calls
	/**
	 * Set the ortus fanart folder location
	 * @param folder
	 */
        public static void SetFanartFolder(String folder) {
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().SetFanartFolder(folder);
            return;
        }
	/**
	 * Get the ortus fanart folder location
	 * @return
	 */
        public static String GetFanartFolder() {
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartFolder();
        }
	/**
	 * Get fanart poster for an media object
	 * @param mediafile
	 * @return path of fanart poster
	 */
	public static String GetFanartPoster(Object mediafile) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartPoster(mediafile);
	}
	/**
	 * Get all fanart posters for a media object
	 * @param mediafile
	 * @return an array of all poster fanart
	 */
	public static List<Object> GetFanartPosters(Object mediafile) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartPosters(mediafile);
	}
	/**
	 * Get fanart banner for a media object
	 * @param mediafile
	 * @return path of fanart banner
	 */
	public static String GetFanartBanner(Object mediafile) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartBanner(mediafile);
	}
	/**
	 * Get all fanart banners for a media object
	 * @param mediafile
	 * @return an array of fanart banners
	 */
	public static List<Object> GetFanartBanners(Object mediafile) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartBanners(mediafile);
	}
	/**
	 * Get fanart background for a media object
	 * @param mediafile
	 * @return path of fanart background
	 */
	public static String GetFanartBackground(Object mediafile) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartBackground(mediafile);
	}
	/**
	 * Get all fanart backgrounds for a media object
	 * @param mediafile
	 * @return an array of fanart backgrounds
	 */
	public static List<Object> GetFanartBackgrounds(Object mediafile) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartBackgrounds(mediafile);
	}
	/**
	 * Randomize an array of fanart
	 * @param fanart array
	 * @return randomized fanart array
	 */
	public static List<Object> GetFanartRandom(List<Object> fanart) {
		return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartRandom(fanart);
	}
	/**
	 *
	 * @param castname
	 * @return
	 */
        public static String GetCastFanartPoster(String castname) {
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetCastFanartPoster(castname);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetSeasonFanartBanner(Object MediaObject) {
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetSeasonFanartBanner(MediaObject);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static List<Object> GetSeasonFanartBanners(Object MediaObject) {
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetSeasonFanartBanners(MediaObject);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetSeasonFanartPoster(Object MediaObject) {
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetSeasonFanartPoster(MediaObject);
        }
	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static List<Object> GetSeasonFanartPosters(Object MediaObject) {
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetSeasonFanartPosters(MediaObject);
        }
	/**
	 *
	 * @param MenuType
	 * @return
	 */
	public static String GetMenuBackground(String MenuType){
            return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetMenuBackground(MenuType);
       }

	/**
	 *
	 * @param MenuType
	 * @return
	 */
	public static List<String> GetMenuBackgrounds(String MenuType){
           return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetMenuBackgrounds(MenuType);
        }

	/**
	 *
	 * @param MediaObjects
	 * @throws IOException
	 */
	public static void CreateFanartFromJPG(Object[] MediaObjects)throws IOException {
             ortustve.media.fanart.FanartFactory.getInstance().getProvider().CreateFanartFromJPG(MediaObjects);
        }

	/**
	 *
	 * @param MediaObjects
	 * @param Type
	 * @return
	 */
	public static Map<String,List> GetFanartCleanupList(Object[] MediaObjects,String Type){
           return ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartCleanupList(MediaObjects, Type);
        }

	/**
	 *
	 * @param MediaObjects
	 * @return
	 */
	public static Map<String,List> GetFanartCleanupList(Object[] MediaObjects){
            Object[] MediaTV = (Object[]) sagex.api.Database.FilterByBoolMethod(MediaObjects, "ortus_api_IsMediaTypeTV", true);
            Object[] MediaMovies = (Object[]) sagex.api.Database.FilterByBoolMethod(MediaObjects, "ortus_api_IsMediaTypeTV", false);
            Map<String,List> TV = ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartCleanupList(MediaTV,"TV");
            Map<String,List> Movies =ortustve.media.fanart.FanartFactory.getInstance().getProvider().GetFanartCleanupList(MediaMovies,"Movies");
            TV.putAll(Movies);

            return TV;
        }

	/**
	 *
	 * @param FoldersMap
	 * @param Type
	 */
	public static void FanartCleanupMove(HashMap<String,List> FoldersMap,String Type){
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().FanartCleanupMove(FoldersMap, Type);
        }

	/**
	 *
	 * @param FoldersMap
	 */
	public static void FanartCleanupMove(HashMap<String,List> FoldersMap){
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().FanartCleanupMove(FoldersMap, "All");
        }

	/**
	 *
	 * @param Folder
	 * @param Type
	 */
	public static void FanartCleanupMove(String Folder,String Type){
            HashMap<String,List> List = new HashMap<String,List>();
            List.put(Folder, null);
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().FanartCleanupMove(List,Type);
        }

	/**
	 *
	 * @param Folder
	 */
	public static void FanartCleanupMove(String Folder){
            HashMap<String,List> List = new HashMap<String,List>();
            List.put(Folder, null);
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().FanartCleanupMove(List, "ALL");
        }

	/**
	 *
	 * @param FoldersMap
	 */
	public static void FanartCleanupDelete(HashMap<String,List> FoldersMap){
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().FanartCleanupDelete(FoldersMap);
        }

	/**
	 *
	 * @param Folder
	 */
	public static void FanartCleanupDelete(String Folder){
            HashMap<String,List> List = new HashMap<String,List>();
            List.put(Folder, null);
            ortustve.media.fanart.FanartFactory.getInstance().getProvider().FanartCleanupDelete(List);
        }

       	/**
	 * Get the value of a theme property
	 * @param PropertyName Property Name
	 * @return Property Value
	 */
	public static String GetThemePropertyImage(String PropertyName) {
		return Ortus.getInstance().getTheme().GetThemePropertyImage(PropertyName);
	}

       	/**
	 * Get the value of a theme property
	 * @param PropertyName Property Name
	 * @return Property Value
	 */
	public static String GetThemeProperty(String PropertyName) {
		return Ortus.getInstance().getTheme().GetThemeProperty(PropertyName);
	}
	/**
	 * Set the value of a theme property
	 * @param PropertyKey Property Name
	 * @param PropertyValue Property Value
	 */
	public static void SetThemeProperty(String PropertyKey, String PropertyValue) {
		Ortus.getInstance().getTheme().SetThemeProperty(PropertyKey,PropertyValue);
		return;
	}
	/**
	 *
	 * @param PropertyName
	 */
	public static void RemoveThemeProperty(String PropertyName) {
		Ortus.getInstance().getTheme().RemoveThemeProperty(PropertyName);
		return;
	}
	/**
	 * Load a new ortus theme
	 * @param theme Theme name
	 */
	public static void LoadTheme(String theme) {
		Ortus.getInstance().getTheme().LoadTheme(theme);

		return;
	}
	/**
	 * Get a theme description
	 * @param theme Theme name
	 * @return Theme description
	 */
	public static String GetThemeDesc(String theme) {
		return Ortus.getInstance().getTheme().GetThemeDesc(theme);
	}

	/**
	 * Get an array of all ortus themes
	 * @return Array of themes
	 */
	public static Object[] GetThemes() {
		return Ortus.getInstance().getTheme().GetThemes();
	}

// ortus.menu

	/**
	 * Return a list of Main Menu Items
	 * @return Vector of menu items
	 */
	public static Object[] GetMenu() {
            DebugLog(TRACE, "Ortus: GetMenu");
		return Ortus.getInstance().getMenu().getMenu();
	}

	/**
	 *
	 * @param menutitle
	 * @return
	 */
	public static String GetMenuType(String menutitle) {
            return Ortus.getInstance().getMenu().GetMenuType(menutitle);
        }
	/**
	 *
	 * @param menutitle
	 * @param menutype
	 */
	public static void SetMenuType(String menutitle, String menutype) {
            Ortus.getInstance().getMenu().SetMenuType(menutitle, menutype);
            return;
        }

	/**
	 * Return Sage menu to execute for a menu item
	 * @param m Menu Name
	 * @return Sage Menu to execute
	 */
	public static String GetMenuAction(String m) {
		return Ortus.getInstance().getMenu().GetMenuAction(m);
	}

	/**
	 * Return Sage menu to execute for a sub menu item
	 * @param m Menu Name
	 * @param s Sub Menu Name
	 * @return Sage menu to execute
	 */
	public static String GetSubMenuAction(String m, String s) {
		return Ortus.getInstance().getMenu().getSubMenuAction(m,s);
	}

	/**
	 * Return a list of Static variables to set upon selection of a menu item
	 * @param m Menu Name
	 * @return HashMap of Static variables/values
	 */
	public static HashMap<String, String> GetMenuStatics(String m) {
              DebugLog(TRACE,"ortus_api_GetMenuStatics: " + m);
              HashMap<String, String> x = new HashMap<String,String>();

              usermenu y;
              try {
                y = Ortus.getInstance().getMenu();
                if ( y == null) {
                    DebugLog(TRACE2,"Ortus.getInstance().getMenu() is null");
                    return null;
                }
              }catch(Exception e ) {
                  DebugLog(ERROR, "GetMenuStatics: get thread var exception " + e);
                  return null;
              }
              try {

                x = y.getMenuStatics(m);
              }catch(Exception e ) {
                  DebugLog(ERROR, "GetMenuStatics: getMenuStatic " + e);
                  return null;
              }

                DebugLog(TRACE,"ortus_api_GetMenuStatics returning");
                return x;
	}

	/**
	 * Return a list of Static variables to set upon selection of a sub menu item
	 * @param m Menu Name
	 * @param s Sub Menu Name
	 * @return Sage menu to execute
	 */
	public static HashMap<String, String> GetSubMenuStatics(String m, String s) {
		return Ortus.getInstance().getMenu().getSubMenuStatics(m, s);
	}

	/**
	 * Return a sub menu for a main menu item
	 * @param m Main Menu
	 * @return Sub menu for a main menu
	 */
	public static Object[] GetSubMenu(String m) {
		return Ortus.getInstance().getMenu().getSubMenu(m);
	}

	/**
	 * Delete a main menu item
	 * @param m Main Menu Title
	 * @return return code
	 */
	public static int DeleteMenu(String m) {
		return Ortus.getInstance().getMenu().deleteMenu(m);
	}

	/**
	 * Add a new Main Menu
	 * @param mt Main Menu Title
	 * @param ma Sage menu to execute
	 */
	public static void AddMenu(String mt, String ma) {
		Ortus.getInstance().getMenu().addMenu(mt, ma);
		return;
	}

	/**
	 * Update a Main Menu title
	 * @param mt Main Menu Title
	 * @param nmt New Main Menu Title
	 */
	public static void UpdateMenuTitle(String mt, String nmt) {
		Ortus.getInstance().getMenu().updateMenuTitle(mt, nmt);

		return;
	}

	/**
	 * Update a Main Menu Action
	 * @param mt Main Menu Title
	 * @param nma Sage menu name
	 * @return return code
	 */
	public static int UpdateMenuAction(String mt, String nma) {
		return Ortus.getInstance().getMenu().updateMenuAction(mt, nma);
	}

	/**
	 * Add a new Static Variable/Value for a main menu item
	 * @param mt Main Menu Title
	 * @param gn Static Variable Name
	 * @param gv Static Variable Value
	 * @return return code
	 */
	public static int AddMenuStatic(String mt, String gn, String gv) {
		return Ortus.getInstance().getMenu().addMenuStatic(mt, gn, gv);
	}

	/**	 * Update a Main Menu Static variable
	 * @param mt Main Menu Title
	 * @param gn Static Variable Name
	 * @param gv Static Variable Value
	 * @return return code
	 */
	public static int UpdateMenuStatic(String mt, String gn, String gv) {
		return Ortus.getInstance().getMenu().updateMenuStatic(mt, gn, gv);
	}

	/**
	 * Delete a Static Variable for a Main Menu Item
	 * @param mt Main Menu Title
	 * @param gn Static Variable Name
	 * @return return code
	 */
	public static int DeleteMenuStatic(String mt, String gn) {
		return Ortus.getInstance().getMenu().deleteMenuStatic(mt, gn);
	}

	/**
	 * Increase the menu position
	 * @param mt Main Menu Title
	 */
	public static void IncPosition(String mt) {
		Ortus.getInstance().getMenu().incPosition(mt);
		return;
	}

	/**
	 * Decrease the menu position
	 * @param mt Main Menu Title
	 */
	public static void DecPosition(String mt) {
		Ortus.getInstance().getMenu().decPosition(mt);
		return;
	}

	/**
	 * Add a new Sub Menu Item
	 * @param mt Main Menu Title
	 * @param smt Sub Menu Title
	 * @param sma Sage menu for sub menu action
	 * @return return code
	 */
	public static int AddSubMenu(String mt, String smt, String sma) {
		return Ortus.getInstance().getMenu().addSubMenu(mt, smt, sma);
	}

	/**
	 * Update Sub Menu Title
	 * 	@param mt Main Menu Title
	 *	@param smt Sub Menu Titile
	 * 	@param nsmt New Sub Menu Title
	 * @return return code
	 */
	public static int UpdateSubMenuTitle(String mt, String smt, String nsmt) {
		return Ortus.getInstance().getMenu().updateSubMenuTitle(mt, smt, nsmt);
	}

	/**
	 * Update a Sub Menu Item Action
	 * @param mt Main Menu Title
	 * @param smt Sub Menu Title
	 * @param nsma Sage menu to execute
	 * @return return code
	 */
	public static int UpdateSubMenuAction(String mt, String smt, String nsma) {
		return Ortus.getInstance().getMenu().updateSubMenuAction(mt, smt, nsma);
	}

	/**
	 * Delete a Sub Menu Item
	 * @param mt Main Menu Title
	 * @param smt Sub Menu Title
	 * @return return code
	 */
	public static int DeleteSubMenu(String mt, String smt) {
		return Ortus.getInstance().getMenu().deleteSubMenu(mt, smt);
	}

	/**
	 * Add new Static variable for a Sub Menu Item
	 * @param mt Main Menu Title
	 * @param smt Sub Menu Title
	 * @param gn Static Variable Name
	 * @param gv Static Variable Value
	 * @return return code
	 */
	public static int AddSubMenuStatic(String mt, String smt, String gn, String gv) {
		return Ortus.getInstance().getMenu().addSubMenuStatic(mt, smt, gn, gv);
	}

	/**
	 * Update a Static Variable for a Sub Menu Item
	 * @param mt Main Menu Title
	 * @param smt Sub Menu Title
	 * @param gn Static Variable Name
	 * @param gv Static Variable Value
	 * @return return code
	 */
	public static int UpdateSubMenuStatic(String mt, String smt, String gn, String gv) {
		return Ortus.getInstance().getMenu().updateSubMenuStatic(mt, smt, gn, gv);
	}

	/**
	 * Delete a Sub Menu Static Variable
	 * @param mt Main Menu Title
	 * @param smt Sub Menu Title
	 * @param gn Static Variable Name
	 * @return return code
	 */
	public static int DeleteSubMenuStatic(String mt, String smt, String gn) {
		return Ortus.getInstance().getMenu().deleteSubMenuStatic(mt, smt, gn);
	}

	/**
	 *
	 * @param mt
	 * @param smt
	 */
	public static void IncSubMenuPosition(String mt, String smt) {
		Ortus.getInstance().getMenu().incSubMenuPosition(mt, smt);
		return;
	}

	/**
	 *
	 * @param mt
	 * @param smt
	 */
	public static void DecSubMenuPosition(String mt, String smt) {
		Ortus.getInstance().getMenu().decSubMenuPosition(mt, smt);
		return;
	}

// ortus.db api

	/**
	 *
	 */
	public static void StartFavoriteExcluder() {
	      Ortus.getInstance().StartFavoriteExcluder();
      }
      /**
       *
       */
      public static void StopFavoriteExcluder() {
	      Ortus.getInstance().StopFavoriteExcluder();
      }
      /**
       *
       */
      public static void StartCron() {
	      Ortus.getInstance().StartCron();
      }
      /**
       *
       */
      public static void StopCron() {
	      Ortus.getInstance().StopCron();
      }
      /**
       *
       */
      public static void StartDB() {
	      Ortus.getInstance().StartDB();
      }

      /**
       *
       */
      public static void StopDB() {
		Ortus.getInstance().StopDB();
      }

      /**
       *
       * @return
       */
      public static Connection GetConnection() {
          return Ortus.getInstance().getDB().GetConnection();
      }
      /**
       *
       * @param sql
       * @return
       */
      public static int executeSQL(String sql) {
            return Ortus.getInstance().getDB().executeSQL(sql);
        }

      /**
       *
       * @param run_interval
       * @param run_method
       * @param run_parms
       */
      public static void AddCron(long run_interval, String run_method, Object[] run_parms) {
	      Ortus.getInstance().getCronServer().AddCron(run_interval, run_method, run_parms);
      }

      /**
       *
       * @param run_interval
       * @param run_method
       * @param run_parms
       */
      public static void RemoveCron(long run_interval, String run_method, Object[] run_parms) {
	      Ortus.getInstance().getCronServer().RemoveCron(run_interval, run_method, run_parms);
      }
        /**
         * Execute an SQL Query and return rows
         * @param sql SQL to execute
         * @return Array of data
         */
        public static List<Object> executeSQLQuery(String sql) {
            return Ortus.getInstance().getDB().executeSQLQuery(sql);
        }
        /**
         * Execute an SQL Query and return rows
         * @param sql SQL to execute
         * @return Array of data
         */
        public static List<Object> executeSQLQueryCache(String sql) {
            return Ortus.getInstance().getDB().executeSQLQueryCache(sql);
        }	
        /**
         * Execute an SQL Query and return rows
         * @param sql SQL to execute
         * @return Array of data
         */
        public static List<List> executeSQLQueryArray(String sql) {
            return Ortus.getInstance().getDB().executeSQLQueryArray(sql);
        }
        /**
         * Execute an SQL Query and return rows
         * @param sql SQL to execute
         * @return Array of data
         */
        public static List<List> executeSQLQueryArrayCache(String sql) {
            return Ortus.getInstance().getDB().executeSQLQueryArrayCache(sql);
        }

	        /**
         * Execute an SQL Query and return rows
         * @param sql SQL to execute
         * @return Array of data
         */
        public static List<HashMap> executeSQLQueryHash(String sql) {
            return Ortus.getInstance().getDB().executeSQLQueryHash(sql);
        }
        /**
         * Execute an SQL Query and return rows
         * @param sql SQL to execute
         * @return Array of data
         */
        public static List<HashMap> executeSQLQueryHashCache(String sql) {
            return Ortus.getInstance().getDB().executeSQLQueryHashCache(sql);
        }


        /**
         * Return MediaObjects based on where clause
         * @param sql Where cluase to pass
         * @return MediaObjects that match the where clause
         */
        public static List<Object> getMediaFilesSQL(String sql) {
            return Ortus.getInstance().getDB().getMediaFilesSQL(sql);
        }
       /**
         * Return MediaObjects based on where clause
         * @param sql Where cluase to pass
         * @return MediaObjects that match the where clause
         */
        public static List<Object> getSageMediaFilesSQL(String sql) {
            return Ortus.getInstance().getDB().getSageMediaFilesSQL(sql);
        }
	/**
	 *
	 * @return
	 */
	public static boolean IsRemoteHost() {

		if ( ortustve.api.GetProperty("remotehost", "none").equalsIgnoreCase("none"))
			return false;
		else
			return true;
	}
	/**
	 *
	 * @param commandparm
	 * @return
	 */
	public static Object ExecuteRemoteCMD(Object[] commandparm) {
		if ( ! IsRemoteHost())
			return null;
		return ortustve.daemon.api.executecCMD(ortustve.api.GetProperty("remotehost", null), commandparm);
	}

	public static void AddProcessQueue(Object[] o) {
		Ortus.getInstance().getProcessServer().AddQueue(o);
	}
	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static List<Object> GetScrapperMatches(Object mediafile) {
            return ortustve.onlinescrapper.api.GetScrapperMatches(mediafile);
        }

	/**
	 *
	 * @return
	 */
	public static List<Object> GetScrapperUnmatchedMedia() {
            return ortustve.onlinescrapper.api.GetScrapperUnmatchedMedia();
        }

	/**
	 *
	 * @return
	 */
	public static List<Object> GetScrapperUnmatchedMediaStub() {
		List<Object> result = new ArrayList<Object>();
		DebugLog(TRACE2,"remote command starting");
		Object remresult = ortustve.api.ExecuteRemoteCMD(new Object[] { "ortus.api.GetScrapperUnmatchedMediaRemote"});

		DebugLog(TRACE2,"remote command returned: " + remresult);
		try {
			DebugLog(TRACE2,"startin");
			DebugLog(TRACE2,"size: " + ((List<Object>)remresult).size());
			for ( Object x : ((List<Object>)remresult)) {
				DebugLog(TRACE2,"processing: " + x);
				result.add(MediaFileAPI.GetMediaFileForID(Integer.parseInt((String)x)));
			}
		} catch(Exception e) {
			DebugLog(TRACE2,"Exception: " + e);
		}
		return result;
		
	}

	/**
	 *
	 * @return
	 */
	public static List<Object> GetScrapperUnmatchedMediaRemote() {
            return ortustve.onlinescrapper.api.GetScrapperUnmatchedMediaRemote();
        }

	/**
	 *
	 * @return
	 */
	public static List<Object> GetScrapperMatchedMedia() {
            return ortustve.onlinescrapper.api.GetScrapperMatchedMedia();
        }
	/**
	 *
	 * @param mediafile
	 * @param scantype
	 * @return
	 */
	public static List<Object> GetScrapperMatches(Object mediafile, int scantype) {
            return ortustve.onlinescrapper.api.GetScrapperMatches(mediafile,scantype);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static int GetScrapperScanType(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperScanType(scrapperid);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static String GetScrapperSearchTitle(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperSearchTitle(scrapperid);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static String GetScrapperFoundTitle(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperFoundTitle(scrapperid);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static String GetScrapperFoundKey(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperFoundKey(scrapperid);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static String GetScrapperCacheDescription(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperCacheDescription(scrapperid);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static Object GetScrapperCacheDate(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperCacheDate(scrapperid);
        }
	/**
	 *
	 * @param scrapperid
	 * @return
	 */
	public static Object GetScrapperCacheMpaa(Object scrapperid) {
            return ortustve.onlinescrapper.api.GetScrapperCacheMpaa(scrapperid);
        }

	/**
	 *
	 * @param mediafile
	 * @param title
	 * @return
	 */
	public static int ManualMovieSearch(Object mediafile, String title) {
            return ortustve.onlinescrapper.api.ManualMovieSearch(mediafile, title);
        }
 
	/**
	 *
	 * @param mediafile
	 * @param scrapperid
	 * @param download_fanart
	 * @return
	 */
	public static boolean ManualMovieMatch(Object mediafile, Object scrapperid, boolean download_fanart){
            return ortustve.onlinescrapper.api.ManualMovieMatch(mediafile, scrapperid, download_fanart);
        }

	/**
	 *
	 * @return
	 */
	public static boolean IsManualScanRunning() {
            return ortustve.onlinescrapper.api.manual_index_running;
        }

	/**
	 *
	 * @return
	 */
	public static ScanType GetScanType() {
		return ortustve.onlinescrapper.api.GetScanType();
	}
	/**
	 *
	 */
	public static void cleanMedia() {
            ortustve.onlinescrapper.api.cleanMedia();
            return;
        }
	/**
	 *
	 */
	public static void cleanMediaBG() {
	    Ortus.getInstance().getProcessServer().AddQueue(new Object[] {"ortus.onlinescrapper.api.cleanMedia"});
            return;
        }

	/**
	 *
	 */
	public static void indexMediaRecordings() {
            if ( ! ortustve.api.IsOrtusInitialized()) {
                DebugLog(ERROR,"indexMediaRecordings: Jumpted the gun");
                return;
            }

            if ( ! ortustve.onlinescrapper.api.index_running )
		    Ortus.getInstance().getProcessServer().AddQueue(new Object[] {"ortus.onlinescrapper.api.indexMediaRecordings"});
//                new Thread(new ortus.daemonWorker("indexrecording"),"daemonWorker").start();
            else
                DebugLog(ERROR,"indexMedia: Already running");
            return;
        }

	/**
	 *
	 * @param fullscan
	 * @param downloadfanart
	 */
	public static void indexMedia(int fullscan, int downloadfanart) {
            if ( ! ortustve.onlinescrapper.api.index_running )
                ortustve.onlinescrapper.api.indexMediaAll(ortustve.onlinescrapper.api.METADATA_update, ortustve.onlinescrapper.api.FANART_update);
            else
                DebugLog(ERROR,"indexMedia: Already running");
            return;
        }

        /**
         * Build sql index from Wiz.bin data in the background
	 * @param metadata
	 * @param fanart
	 */
//        public static void indexMediaBG() {
//            new Thread(new ortus.daemonWorker("runindex"),"daemonWorker").start();
//            return;
//        }

        public static void indexMediaBG(int metadata, int fanart) {
            if ( ! (Boolean)ortustve.process.executeRemote(new Object[] {"ortus.onlinescrapper.api.IsindexMediaRunning"}) ) {
			ortustve.process.executeRemote(new Object[] { "ortus.api.BackgroundIndexMediaBG", metadata, fanart});
			if ( IsRemoteHost() )
				ortustve.api.AddCron(5, "ortus.api.CronUpdateScanStatus", new Object[] {} );
	    }
           else
                DebugLog(ERROR,"indexMedia: Already running");
           return;
        }

	/**
	 *
	 * @param metadata
	 * @param fanart
	 */
	public static void BackgroundIndexMediaBG(int metadata, int fanart) {
            if ( ! (Boolean)ortustve.process.executeRemote(new Object[] {"ortus.onlinescrapper.api.IsindexMediaRunning"}) )
		    Ortus.getInstance().getProcessServer().AddQueue( new Object[] { "ortus.onlinescrapper.api.indexMediaAll", metadata, fanart});
	    //			new Thread(new ortus.daemonWorker("runindex:" + metadata + ":" + fanart),"daemonWorker").start();
           return;
       }

       /**
	*
	*/
       public static void GetMissingFanart() {
           if ( ! ortustve.onlinescrapper.api.index_running )
		   Ortus.getInstance().getProcessServer().AddQueue(new Object[] { "ortus.onlinescrapper.api.GetMissingFanart"});
//                new Thread(new ortus.daemonWorker("missingfanart"),"daemonWorker").start();
           else
                DebugLog(ERROR,"indexMedia: Already running");
            return;
        }

       /**
	*
	*/
       public static void GetScanFanart() {
		Ortus.getInstance().getProcessServer().AddQueue(new Object[] {"ortus.onlinescrapper.api.GetScanFanart"});
//		new Thread(new ortus.daemonWorker("scanfanart"), "daemonWorkder").start();
	}

        /**
         * Check if indexMedia process is running
         * @return
         */
        public static boolean IsindexMediaRunning() {
		return ortustve.onlinescrapper.api.IsindexMediaRunning();
        }

	/**
	 *
	 */
	public static void CronUpdateScanStatus() {
//		DebugLog(TRACE2,"CronUpdateScanStatus: running");
		HashMap<String,Object> result = (HashMap)ortustve.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperDetail"});
//		DebugLog(TRACE2,"result: " + result.toString());
		ortustve.onlinescrapper.api.index_running = (Boolean)result.get("index_running");
		ortustve.onlinescrapper.api.total_queue = (Integer)result.get("total_queue");
                ortustve.onlinescrapper.api.total_matches = (Integer)result.get("total_matches");
		ortustve.onlinescrapper.api.total_movies_match = (Integer)result.get("total_movies_match");
		ortustve.onlinescrapper.api.total_series_match = (Integer)result.get("total_series_match");
		ortustve.onlinescrapper.api.total_match_property = (Integer)result.get("total_match_property");
		ortustve.onlinescrapper.api.total_miss = (Integer)result.get("total_miss");
		ortustve.onlinescrapper.api.total_bypass = (Integer)result.get("total_bypass");
		ortustve.onlinescrapper.api.total_processed = (Integer)result.get("total_processed");
		ortustve.onlinescrapper.api.current_mediaid = (Integer)result.get("current_mediaid");
		ortustve.onlinescrapper.api.scan_start_time = (Long)result.get("scan_start_time");
		ortustve.onlinescrapper.api.scan_end_time = (Long)result.get("scan_end_time");
		ortustve.onlinescrapper.api.st = (ScanType)result.get("scantype");

		if ( ! ortustve.onlinescrapper.api.index_running )
			ortustve.api.RemoveCron(5, "ortus.api.CronUpdateScanStatus", new Object[] {});
	}
        /**
         * Cancel currently running scan
         */
        public static void CancelIndexMedia() {
			ortustve.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.CancelIndexMedia"});
        }
	/**
	 * Get scapper detail
	 * @return array
	 */
	public static HashMap<String,String> GetScrapperDetail() {
			return (HashMap)ortustve.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperDetail"});
	}
        /**
         * Get the queue size of the current media index scan
         * @return queue size
         */
        public static int GetScrapperQueueSize() {
		return ortustve.onlinescrapper.api.GetScrapperQueueSize();
//		return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperQueueSize"});
        }
        /**
         * Get the number of media items processed by the background scanning process
         * @return
	*/
        public static int GetScrapperProcessed() {
		return ortustve.onlinescrapper.api.GetScrapperProcessed();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperProcessed"});
        }
        /**
         * Return the percentage completed for a background scan
         * @return Percentage
         */
        public static int GetScrapperPercentComplete() {
		return ortustve.onlinescrapper.api.GetScrapperPercentComplete();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperPercentComplete"});
	}
	/**
         * Return the percentage of matched media items
         * @return Percentage
         */
        public static int GetScrapperPercentMatched() {
		return ortustve.onlinescrapper.api.GetScrapperPercentMatched();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.online.scrapper.api.GetScrapperPercentMatched"});
        }
        /**
         * Return the percentage of matched media items
         * @return Percentage
         */
        public static int GetScrapperPercentMatchedLibrary() {
		return ortustve.onlinescrapper.api.GetScrapperPercentMatchedLibrary();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperPercentMatchedLibrary"});
	}

        /**
         * Return the percentage of missed media items
         * @return
         */
       public static int GetScrapperPercentMissed() {
	       return ortustve.onlinescrapper.api.GetScrapperPercentMissed();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperPercentMissed"});
        }
        /**
         * Return the percentage of matched media items
         * @return Percentage
         */
        public static int GetScrapperPercentMissedLibrary() {
		return ortustve.onlinescrapper.api.GetScrapperPercentMissedLibrary();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperPercentMissedLibrary"});
        }

        /**
         * Get the current media id being processed by the background index scan
         * @return
         */
        public static int GetScrapperCurrent() {
		return ortustve.onlinescrapper.api.GetScrapperCurrent();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperCurrent"});
        }
        /**
         * Get the number of matched items in the background index scan
         * @return
         */
        public static int GetScrapperMatched() {
		return ortustve.onlinescrapper.api.GetScrapperMatched();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperMatched"});
	}
	/**
	 * Return number of items that matched from a property file
	 *
	 * @return
	 */
	public static int GetScrapperMatchedProperty() {
		return ortustve.onlinescrapper.api.GetScrapperMatchedProperty();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperMatchedProperty"});
	}
        /**
         * Return total media items bypassed in background index scan
         * @return
         */
        public static int GetScrapperBypassed() {
		return ortustve.onlinescrapper.api.GetScrapperBypassed();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperBypassed"});
        }
        /**
         * Get the number of missed items in the background index scan
         * @return
         */
        public static int GetScrapperMissed() {
		return ortustve.onlinescrapper.api.GetScrapperMissed();
//			return (Integer)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperMissed"});
        }
        /**
         * Return the start time of background index scan
         * @return
         */
        public static long GetScrapperStartTime() {
		return ortustve.onlinescrapper.api.GetScrapperStartTime();
//			return (Long)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperStartTime"});
        }
        /**
         * Return the end of the last background index scan
         * @return
         */
        public static long GetScrapperEndTime() {
		return ortustve.onlinescrapper.api.GetScrapperEndTime();
//			return (Long)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperEndTime"});
        }
        /**
         * Return the number of minutes the background index scan has been running
         * @return
         */
        public static String GetScrapperElapsedMinutes() {
		return ortustve.onlinescrapper.api.GetScrapperElapsedMinutes();
//			return (String)ortus.process.executeRemote(new Object[] { "ortus.onlinescrapper.api.GetScrapperElapsedMinutes"});
	}
        /**
         * Create TVDB Series Tables
         * @return
         */
        public static boolean createDB() {
            return Ortus.getInstance().getDB().createDB();
        }
        /**
         * Run backup of database
         * @return
         */
        public static boolean backupDB() {
            return Ortus.getInstance().getDB().backupDB();
        }
        /**
         * Start Tcp DB Server Interface
         */
        public static void StartTcpServer() {
            Ortus.getInstance().getDB().StartTcpServer();
        }
        /**
         * Stop Tcp DB Server Interface
         */
        public static void StopTcpServer() {
            Ortus.getInstance().getDB().StopTcpServer();
        }
        /**
         * Check to see if Tcp DB Interface is started
         * @return true/false
         */
        public static boolean IsTcpServerRunning() {
            return Ortus.getInstance().getDB().IsTcpServerRunning();
        }
        /**
         * Start Web DB Interface
         */
        public static void StartWebServer() {
            Ortus.getInstance().getDB().StartWebServer();
        }
        /**
         * Stop Web DB Interface
         */
        public static void StopWebServer() {
            Ortus.getInstance().getDB().StopWebServer();
        }
        /**
         * Check to see if Web DB Interface is running
         * @return true/false
         */
        public static boolean IsWebServerRunning() {
            return Ortus.getInstance().getDB().IsWebServerRunning();
        }
        /**
         * Start PostGres DB inteface for ODBC use
         */
        public static void StartPgServer() {
            Ortus.getInstance().getDB().StartPgServer();
        }
        /**
         * Stop Postgres DB Interface
         */
        public static void StopPgServer() {
            Ortus.getInstance().getDB().StopPgServer();
        }
        /**
         * Check to see if Postgres DB Interface is running
         * @return
         */
        public static boolean IsPgServerRunning() {
            return Ortus.getInstance().getDB().IsPgServerRunning();
        }

	/**
	 *
	 * @return
	 */
	public static List<Object> GetDBStatus() {
		return Ortus.getInstance().getDB().GetStatus();
	}

//ortus.Metadata
	/**
	 *
	 * @return
	 */
	public static String GetMediaCacheToString() {
		return ortustve.cache.cacheEngine.getInstance().toString();
	}
	/**
	 *
	 */
	public static void PreLoadCache() {
		ortustve.cache.cacheEngine.getInstance().PreLoadCache();
	}
	public static void LoadSageMediaCache() {
		ortustve.cache.cacheEngine.getInstance().LoadSageMediaCache();
	}
	/**
	 *
	 * @return
	 */
	public static String GetMediaCacheStats() {
		return ortustve.cache.cacheEngine.getInstance().getProvider().GetStats();
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetDescription(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetDescription(mediafile);
	}
	public static String GetSageDesciption(Object smo) {
		return MetadataFactory.getInstance().getProvider().GetSageDescription(smo);
	}

	/**
	 *
	 * @param mediafile
	 * @param description
	 */
	public static void SetDescription(Object mediafile, String description) {
		MetadataFactory.getInstance().getProvider().SetDescription(mediafile, description);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetMediaTitle(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetMediaTitle(mediafile);
	}
	public static String GetSageMediaTitle(Object smo) {
		return MetadataFactory.getInstance().getProvider().GetSageMediaTitle(smo);
	}
	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetMediaFileID(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetMediaFileID(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static long GetOriginalAirDate(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetOriginalAirDate(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetShowTitle(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetShowTitle(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetEpisodeTitle(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetEpisodeTitle(mediafile);
	}
	public static String GetSageEpisodeTitle(Object smo) {
		return MetadataFactory.getInstance().getProvider().GetSageEpisodeTitle(smo);
	}
	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static int GetSeasonNumber(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetSeasonNumber(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static int GetEpisodeNumber(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetEpisodeNumber(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static int GetDiscNumber(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetDiscNumber(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsTV(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsTV(mediafile);
	}

	/**
	 *
	 * @param mf
	 * @return
	 */
	public static boolean IsTVMovie(Object mf) {
		return MetadataFactory.getInstance().getProvider().IsTVMovie(mf);
	}

	/**
	 *
	 * @param mf
	 * @return
	 */
	public static boolean IsImportedTV(Object mf) {
		return MetadataFactory.getInstance().getProvider().IsImportedTV(mf);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsRecorded(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsRecorded(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsIntelligentRecorded(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsIntelligentRecorded(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsSeries(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsSeries(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsDVD(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsDVD(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsBluRay(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsBluRay(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static boolean IsMovie(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().IsMovie(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static int GetMediaType(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetMediaType(mediafile);
	}
	public static int GetSageMediaType(Object smo) {
		return MetadataFactory.getInstance().getProvider().GetSageMediaType(smo);
	}
	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetMediaPath(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetPath(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @param mediatype
	 */
	public static void SetMediaType(Object mediafile, Object mediatype) {
		MetadataFactory.getInstance().getProvider().SetMediaType(mediafile, mediatype);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetMediaEncoding(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetMediaEncoding(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetVideoEncoding(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetVideoEncoding(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetAudioEncoding(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetAudioEncoding(mediafile);
	}

	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetSubpicEncoding(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetSubpicEncoding(mediafile);
	}
	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static String GetMPAARating(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetMPAARating(mediafile);
	}
	public static String GetSageMPAARating(Object smo) {
		return MetadataFactory.getInstance().getProvider().GetSageMPAARating(smo);
	}
	/**
	 *
	 * @param mediafile
	 * @return
	 */
	public static int GetUserRating(Object mediafile) {
		return MetadataFactory.getInstance().getProvider().GetUserRating(mediafile);
	}
	public static int GetSageUserRating(Object smo) {
		return MetadataFactory.getInstance().getProvider().GetSageUserRating(smo);
	}
//ortus.Search

	/**
	 *
	 * @param params
	 * @return
	 */
	public static List<Object> Search(String params) {
            return MetadataFactory.getInstance().getProvider().Search(params);
        }
//        public List<Object> GetMediaCast(String params) {
//            return MetadataFactory.getInstance().getProvider().GetMediaCast(params);
//        }
//        public List<Object> GetMediaGenre(String params) {
//            return MetadataFactory.getInstance().getProvider().GetMediaGenre(params);
//       }

//ortus.media.TVFavorite
	public static boolean IsFavorteComskipped(Object fav) {
		return ortustve.media.TVFavorite.IsFavoriteComskipped(fav);
	}

	public static boolean IsMediaFileComskipped(Object mf) {
		return ortustve.media.TVFavorite.IsMediaFileComskipped(mf);
	}

//ortus.media.TV

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetShowTitleClean(Object MediaObject) {
		return ortustve.media.TV.GetShowTitleClean(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetShowTitleCleanPostpend(Object MediaObject) {
		return ortustve.media.TV.GetShowTitleCleanPostpend(MediaObject);
	}

	/**
	 *
	 * @param mo
	 * @return
	 */
	public static String GetShowTitleOrMovie(Object mo) {
		return ortustve.media.TV.GetShowTitleOrMovie(mo);
	}
	

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetEpisodeTitleClean(Object MediaObject) {
		return ortustve.media.TV.GetEpisodeTitleClean(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetEpisodeTitleCleanPostpend(Object MediaObject) {
		return ortustve.media.TV.GetEpisodeTitleCleanPostpend(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetSeasonNumberStr(Object MediaObject) {
		return ortustve.media.TV.GetSeasonNumberStr(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetSeasonNumberPad(Object MediaObject) {
		return ortustve.media.TV.GetSeasonNumberPad(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetEpisodeNumberStr(Object MediaObject) {
		return ortustve.media.TV.GetEpisodeNumberStr(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetEpisodeNumberPad(Object MediaObject) {
		return ortustve.media.TV.GetEpisodeNumberPad(MediaObject);
	}

		/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetDiscNumberStr(Object MediaObject) {
		return ortustve.media.TV.GetDiscNumberStr(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetDiscNumberPad(Object MediaObject) {
		return ortustve.media.TV.GetDiscNumberPad(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static int GetSeasonEpisodeNumber(Object MediaObject) {
		return ortustve.media.TV.GetSeasonEpisodeNumber(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static int GetSeasonDiscNumber(Object MediaObject) {
		return ortustve.media.TV.GetSeasonDiscNumber(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static boolean IsWatchedPartial(Object MediaObject) {
		return ortustve.media.TV.IsWatchedPartial(MediaObject);
	}

	/**
	 *
	 * @param MediaObjects
	 * @return
	 */
	public static Object GetLastWatched(Object MediaObjects) {
		return ortustve.media.TV.GetLastWatched(MediaObjects);
	}

	/**
	 *
	 * @param MediaObjects
	 * @return
	 */
	public static Object GetNextShow(Object MediaObjects) {
		return ortustve.media.TV.GetNextShow(MediaObjects);
	}

	/**
	 *
	 * @param MediaObjects
	 * @return
	 */
	public static Object[] GetShowsFromLastWatched(Object MediaObjects) {
		return ortustve.media.TV.GetShowsFromLastWatched(MediaObjects);
	}

	/**
	 *
	 * @param MediaObjects
	 * @param MediaObject
	 * @return
	 */
	public static Object[] GetShowsFromShow(Object MediaObjects, Object MediaObject) {
		return ortustve.media.TV.GetShowsFromShow(MediaObjects, MediaObject);
	}

//ortus.General

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetMediaTitleClean(Object MediaObject) {
		return ortustve.media.General.GetMediaTitleClean(MediaObject);
	}

	/**
	 *
	 * @param MediaObject
	 * @return
	 */
	public static String GetMediaTitleCleanPostpend(Object MediaObject) {
		return ortustve.media.General.GetMediaTitleCleanPostpend(MediaObject);
	}

	/**
	 *
	 * @param MediaObjects
	 * @param NewPlaylistName
	 * @return
	 */
	public static Object MakePlaylist(Object MediaObjects, String NewPlaylistName) {
		return ortustve.media.util.MakePlaylist(MediaObjects, NewPlaylistName);
	}

}

